home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / mlpmodul.sit / MacLogimoPlus Documentation / DEF3 Files / ControlMgr.DEF next >
Encoding:
Modula Definition  |  1990-06-14  |  5.7 KB  |  130 lines  |  [TEXT/PMED]

  1. DEFINITION MODULE ControlMgr;  (* Christoph Fleischer 05.02.85 *)
  2.                                (* MacIntosh Toolbox Control Manager Routines *)
  3.                                (* last modification   26.06.85 fxk*)
  4. FROM SYSTEM IMPORT ADDRESS;               
  5. FROM MacBase IMPORT StrPtr,LongInt,Handle;
  6. FROM WindowMgr IMPORT WindowPtr;
  7. FROM QuickDraw IMPORT Rect,Point;
  8.  
  9. EXPORT QUALIFIED
  10.   drawCntl,testCntl,calcCRgns,initCntl,dispCntl,posCntl,thumbCntl,dragCntl,
  11.   autoTrack,noControl,inButton,inCheckbox,inUpButton,inDownButton,inPageUp,
  12.   inPageDown,inThumb,PushButProc,CheckBoxProc,RadioButProc,ScrollBarProc,UseWFont,
  13.   ControlRecord,ControlPtr,ControlHandle,ControlProcPtr,
  14.   NewControl,DisposeControl,KillControls,MoveControl,SizeControl,DragControl,
  15.   ShowControl,HideControl,SetCTitle,GetCTitle,HiliteControl,SetCRefCon,GetCRefCon,
  16.   SetCtlValue,GetCtlValue,GetCtlMin,GetCtlMax,SetCtlMin,SetCtlMax,GetCtlAction,
  17.   SetCtlAction,TestControl,TrackControl,FindControl,DrawControls,GetNewControl;
  18.  
  19. CONST
  20.   drawCntl     = 0;           (*control messages*)
  21.   testCntl     = 1;
  22.   calcCRgns    = 2;
  23.   initCntl     = 3;
  24.   dispCntl     = 4;
  25.   posCntl      = 5;
  26.   thumbCntl    = 6;
  27.   dragCntl     = 7;
  28.   autoTrack    = 8;
  29.  
  30.   noControl    = 0;           (*FindControl Result Codes*)
  31.   inButton     = 10;
  32.   inCheckbox   = 11;
  33.   inUpButton   = 20;
  34.   inDownButton = 21;
  35.   inPageUp     = 22;
  36.   inPageDown   = 23;
  37.   inThumb      = 129;
  38.  
  39.   PushButProc   = 0;          (*control definition proc ID's*)
  40.   CheckBoxProc  = 1;
  41.   RadioButProc  = 2;
  42.   ScrollBarProc = 16;
  43.  
  44.   UseWFont      = 8;
  45.  
  46.  
  47. TYPE
  48.   ProcPtr = ADDRESS;
  49.   ControlHandle = POINTER TO ControlPtr;
  50.   ControlPtr    = POINTER TO ControlRecord;
  51.   ControlRecord =
  52.      RECORD
  53.        nextControl:        Handle;
  54.        contrlOwner:        WindowPtr;
  55.        contrlRect:         Rect;
  56.        contrlVis:          BOOLEAN;
  57.        contrlHilite:       BOOLEAN;
  58.        contrlValue:        INTEGER;
  59.        contrlMin:          INTEGER;
  60.        contrlMax:          INTEGER;
  61.        contrlDefProc:      Handle;
  62.        contrlData:         Handle;
  63.        contrlAction:       ProcPtr;
  64.        contrlrfCon:        LongInt;
  65.        contrlTitle:        ARRAY[0..255] OF CHAR;(*Str255*)
  66.      END;
  67.  
  68.   ControlProcPtr =  ADDRESS;
  69.  
  70.  
  71. PROCEDURE NewControl(curWindow:      WindowPtr;
  72.                      VAR boundsRect: Rect;
  73.                      title:          StrPtr;
  74.                      visible:        BOOLEAN;
  75.                      value:          INTEGER;
  76.                      min:            INTEGER;
  77.                      max:            INTEGER;
  78.                      contrlProc:     INTEGER;
  79.                      refCon:         LongInt): ControlHandle; (*INLINE $A954*)
  80. PROCEDURE DisposeControl (theControl: ControlHandle);         (*INLINE $A955*)
  81. PROCEDURE KillControls   (theWindow:  WindowPtr);             (*INLINE $A956*)
  82.  
  83. PROCEDURE MoveControl    (theControl: ControlHandle; h,v: INTEGER);
  84.                                                               (*INLINE $A959*)
  85. PROCEDURE SizeControl    (theControl: ControlHandle; w,h: INTEGER);
  86.                                                               (*INLINE $A95C*)
  87. PROCEDURE DragControl    (theControl: ControlHandle; startPt: Point;
  88.                           VAR bounds,slopRect: Rect; axis:INTEGER);
  89.                                                               (*INLINE $A967*)
  90. PROCEDURE ShowControl    (theControl: ControlHandle);         (*INLINE $A957*)
  91. PROCEDURE HideControl    (theControl: ControlHandle);         (*INLINE $A958*)
  92. PROCEDURE SetCTitle      (theControl: ControlHandle;title: StrPtr);
  93.                                                               (*INLINE $A95F*)
  94. PROCEDURE GetCTitle      (theControl: ControlHandle; title: StrPtr);
  95.                                                               (*INLINE $A95E*)
  96. PROCEDURE HiliteControl  (theControl: ControlHandle; hiliteState: INTEGER);
  97.                                                               (*INLINE $A95D*)
  98. PROCEDURE SetCRefCon     (theControl: ControlHandle; data: LongInt);
  99.                                                               (*INLINE $A95B*)
  100. PROCEDURE GetCRefCon     (theControl: ControlHandle): LongInt;(*INLINE $A95A*)
  101.  
  102. PROCEDURE SetCtlValue    (theControl: ControlHandle; theValue: INTEGER);
  103.                                                               (*INLINE $A963*)
  104. PROCEDURE GetCtlValue    (theControl: ControlHandle): INTEGER;(*INLINE $A960*)
  105.  
  106. PROCEDURE GetCtlMin      (theControl: ControlHandle): INTEGER;(*INLINE $A961*)
  107. PROCEDURE GetCtlMax      (theControl: ControlHandle): INTEGER;(*INLINE $A962*)
  108. PROCEDURE SetCtlMin      (theControl: ControlHandle; theValue: INTEGER);
  109.                                                               (*INLINE $A964*)
  110. PROCEDURE SetCtlMax      (theControl: ControlHandle; theValue: INTEGER);
  111.                                                               (*INLINE $A965*)
  112.  
  113. PROCEDURE GetCtlAction   (theControl: ControlHandle): ProcPtr;(*INLINE $A96A*)
  114. PROCEDURE SetCtlAction   (theControl: ControlHandle; newProc: ControlProcPtr);
  115.                                                               (*INLINE $A96B*)
  116.  
  117. PROCEDURE TestControl    (theControl: ControlHandle; thePt: Point): INTEGER;
  118.                                                               (*INLINE $A966*)
  119. PROCEDURE TrackControl   (theControl:ControlHandle; thePt: Point;
  120.                           actionProc:ControlProcPtr):INTEGER; (*INLINE $A968*)
  121.  
  122. PROCEDURE FindControl    (thePoint: Point;
  123.                           theWindow: WindowPtr;
  124.                           VAR theControl: ControlHandle): INTEGER;(*INLINE $A96C*)
  125. PROCEDURE DrawControls   (theWindow: WindowPtr);              (*INLINE $A969*)
  126. PROCEDURE GetNewControl  (controlID: INTEGER; owner: WindowPtr): ControlHandle;
  127.                                                               (*INLINE $A9BE*)
  128.  
  129. END ControlMgr.
  130.